<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
    
<%@ page import="edu.itla.medifacil.persistence.enums.Attribute" %>
<%@ page import="edu.itla.medifacil.persistence.entities.People" %>
<%@ page import="java.util.List" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
	<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/themes/redmond/jquery-ui.css" type="text/css" />
	<link rel="stylesheet" href="../css/style.css" />
	
	
<!-- Google Libraries API: JQuery, JQuery UI -->
	<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
	<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.14/jquery-ui.min.js"></script>
	<script type="text/javascript" src="http://ajax.aspnetcdn.com/ajax/jquery.validate/1.8.1/jquery.validate.min.js"></script>
	
	<script type="text/javascript" src="../js/forms/utilities.js"></script>
	<script type="text/javascript" src="../js/patients/update.js"></script>
	

	<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
	<title>Agregar Asistente</title>
</head>
<body>
	<jsp:include page="../navigation/header.jsp" >
		<jsp:param value="assistents" name="active"/>
	</jsp:include>

	<div id="container">
		<form enctype="multipart/form-data" class="centered" id="assistentForm" method="POST" action="/MediFacil/Assistents.do">
			<input type="hidden" name="action" value="save" />
			
			<fieldset id="personalInfo">
				<legend>Datos Personales</legend>
				
				<div class="input text required duplexInput">
					<label for="firstname">Nombre</label>
					<input type="text" id="firstname" name="name" />
				</div>
				
				<div class="input text required duplexInput">
					<label for="lastname">Apellido</label>
					<input type="text" id="lastname" name="lastname" />
				</div>
				
				<div class="clear"></div>
				
				<div class="input text required duplexInput">
					<label for="identification">Identificaci&oacute;n</label>
					<input type="text" id="identification" name="identification" />
				</div>
				
				<div class="calendar duplexInput" id="fechaNacimiento">
					<label for="birthdate">Fecha de Nacimiento</label>
					<input autocomplete="off" id="birthdate" name="attributes.<%= Attribute.FECHA_NACIMIENTO.getId() %>"/>
				</div>
				
				<div style="width: 301px;" class="input file floatL">
					<label for="picture">Foto</label>
					<input style="width:260px; font-size:10px;" type="file" for="picture" name="attributes.<%= Attribute.FOTO.getId() %>" />
				</div>
				
				<div class="clear"></div>
				
				<fieldset id="assistentDoctors">
					<legend>Doctores a los que Asiste</legend>
					<div class="input multiple">
						<% for( People doctor : (List<People>)	request.getSession().getAttribute( "assistentDoctors" ) ) {%>
							<div class="input checkbox floatL">
								<label for="<%= doctor.getId() %>"><%= doctor.getName() + " " + doctor.getLastName() %></label>
								<input id="<%= doctor.getId() %>" name="doctors.<%= doctor.getId() %>" type="checkbox" value="<%= doctor.getId() %>"/>
							</div>
						<% } %>
					</div>
				</fieldset>
				
			</fieldset>
			
			<fieldset id="contactInfo">
				<legend>Datos de Contacto</legend>
				
				<div class="input input">
					<label for="tel">T&eacute;lefono</label>
					<input id="tel" type="text" name="attributes.<%= Attribute.TELEFONO.getId() %>" />
				</div>
				
				<div class="input input">
					<label for="cel">Celular</label>
					<input id="cel" type="text" name="attributes.<%= Attribute.CELULAR.getId() %>" />
				</div>
				
				<div class="input textarea">
					<label for="direction">Direcci&oacute;n</label>
					<textarea id="direction" name="attributes.<%= Attribute.DIRECCION.getId() %>"></textarea>
				</div>
			</fieldset>

			<div class="clear"></div>
			
			<button type="submit">Agregar</button>
		</form> 
	</div>
	
	<jsp:include page="../navigation/copyright.html" />
</body>
</html>